import Layout from '@/layout'
import RouteButtonsBuilder from '@/framework/infra/router/RouterButtonsBuilder'
import TableButtonType from '@/framework/constant/TableButtonType'

export default [
  {
    path: '/strategy',
    component: Layout,
    meta: { title: '攻略管理', icon: 'el-icon-s-help' },
    children: [
      {
        path: 'type',
        component: () => import('@/feature/strategy/app/type/index'),
        meta: { title: '攻略类型', icon: 'table' },
        buttons: RouteButtonsBuilder.builder('strategy:type')

          .addButtons([
            {
              handler: 'list',
              name: 'list',
              type: TableButtonType.SEARCHBAR,
              label: '搜索',
              icon: 'el-icon-search'
            },
            {
              handler: 'export',
              name: 'export',
              type: TableButtonType.TOOLBAR_RIGHT,
              label: '导出',
              buttonType: 'primary',
              icon: 'el-icon-download'
            },
            {
              handler: 'create',
              name: 'create',
              type: TableButtonType.TOOLBAR,
              label: '新建攻略类型',
              icon: 'el-icon-plus'
            },
            {
              handler: 'update',
              name: 'update',
              type: TableButtonType.ROW,
              label: '修改',
              icon: 'el-icon-edit'
            },
            {
              handler: 'remove',
              name: 'remove',
              type: TableButtonType.ROW,
              label: '删除',
              buttonType: 'danger',
              icon: 'el-icon-delete'
            }

          ])
          .build()
      },
      {
        path: 'administration',
        component: () => import('@/feature/strategy/app/administration/index'),
        meta: { title: '攻略管理', icon: 'table' },
        buttons: RouteButtonsBuilder.builder('strategy:administration').oo({batchOO: true, hasName: true})

          .addButtons([
            {
              handler: 'list',
              name: 'list',
              type: TableButtonType.SEARCHBAR,
              label: '搜索',
              icon: 'el-icon-search'
            },
            {
              handler: 'export',
              name: 'export',
              type: TableButtonType.TOOLBAR_RIGHT,
              label: '导出',
              buttonType: 'primary',
              icon: 'el-icon-download'
            },
            {
              handler: 'create',
              name: 'create',
              type: TableButtonType.TOOLBAR,
              label: '新建旅游攻略',
              icon: 'el-icon-plus'
            },
            {
              handler: 'update',
              name: 'update',
              type: TableButtonType.ROW,
              label: '修改',
              icon: 'el-icon-edit'
            },
            {
              handler: 'remove',
              name: 'remove',
              type: TableButtonType.ROW,
              label: '删除',
              buttonType: 'danger',
              icon: 'el-icon-delete'
            },
            {
              handler: 'goodsManager',
              name: 'lms:strategy-lines',
              type: TableButtonType.ROW,
              label: '修改站点',
              buttonType: 'primary',
              icon: 'el-icon-download'
            }
          ])
          .build()
      },
      {
        path: 'streetType',
        component: () => import('@/feature/streetView/app/type/index'),
        meta: { title: '街道一览', icon: 'table' },
        buttons: RouteButtonsBuilder.builder('strategy:streetType')

          .addButtons([
            {
              handler: 'list',
              name: 'list',
              type: TableButtonType.SEARCHBAR,
              label: '搜索',
              icon: 'el-icon-search'
            },
            {
              handler: 'create',
              name: 'create',
              type: TableButtonType.TOOLBAR,
              label: '新建街道',
              icon: 'el-icon-plus'
            },
            {
              handler: 'update',
              name: 'update',
              type: TableButtonType.ROW,
              label: '修改',
              icon: 'el-icon-edit'
            },
            {
              handler: 'remove',
              name: 'remove',
              type: TableButtonType.ROW,
              label: '删除',
              buttonType: 'danger',
              icon: 'el-icon-delete'
            }
          ])
          .build()
      },
      {
        path: 'fukudaService',
        component: () => import('@/feature/streetView/app/administration/index'),
        meta: { title: '街道旅游攻略', icon: 'table' },
        buttons: RouteButtonsBuilder.builder('strategy:fukudaService').oo({batchOO: false, hasName: true})

          .addButtons([
            {
              handler: 'list',
              name: 'list',
              type: TableButtonType.SEARCHBAR,
              label: '搜索',
              icon: 'el-icon-search'
            },
            // {
            //   handler: 'export',
            //   name: 'export',
            //   type: TableButtonType.TOOLBAR_RIGHT,
            //   label: '导出',
            //   buttonType: 'primary',
            //   icon: 'el-icon-download'
            // },
            {
              handler: 'create',
              name: 'create',
              type: TableButtonType.TOOLBAR,
              label: '新建旅游攻略',
              icon: 'el-icon-plus'
            },
            {
              handler: 'update',
              name: 'update',
              type: TableButtonType.ROW,
              label: '修改',
              icon: 'el-icon-edit'
            },
            {
              handler: 'remove',
              name: 'remove',
              type: TableButtonType.ROW,
              label: '删除',
              buttonType: 'danger',
              icon: 'el-icon-delete'
            }
          ])
          .build()
      }
    ]
  }
]
